package com.itheima.stock.config;


import com.google.common.util.concurrent.RateLimiter;
import com.itheima.stock.propertis.LimiterPropertis;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
@SuppressWarnings("all")
public class RateLimiterConfiguration {
    @Bean
    public RateLimiter rateLimiter(LimiterPropertis limiterPropertis){
        return RateLimiter.create(limiterPropertis.getConcurrentNum());
    }

}
